/*
 * convert.h
 *
 *  Created on: Mar 27, 2009
 *      Author: James Haak
 */

#ifndef CONVERT_H_
#define CONVERT_H_

#include <iostream>
 #include <sstream>
 #include <string>

 inline double convertToDouble(const std::string& s)
 {
   std::istringstream i(s);
   double x;
   i >> x;
   return x;
 }

 template <class T>
 inline std::string convertToString (const T& t)
 {
   std::stringstream ss;
   ss << t;
   return ss.str();
 }

#endif /* CONVERT_H_ */
